#include <stdio.h>
#include <stdlib.h>
#include <sys/signal.h>

void   t_out()
{
    printf("run timeout\n");
    sleep(1);
    return;
}

void TClavier(int idMere)
{
	char c;
	int run=1;
	c='0';
	printf("Claiver created\n");
	while(run)
	{
		printf("TClavier:motor  :id mere %d\n",idMere);

		signal(SIGALRM,t_out);
		alarm(1);
		c=getchar();
		alarm(0);
		if(c=='q')
		{
			kill(idMere,SIGUSR1);
			printf("envoyer SIGUSR1 pour arreter l'application\n");
			run=0;
			exit(0);
		}


		//kill(idMere,SIGUSR1);
		exit(0);
	}

}
